home *** CD-ROM | disk | FTP | other *** search
/ Temic Semiconductors Tech…al Library 1997 February / Temic Semiconductors Technical Library - 1997 February.iso / TEMIC2.DIR / 00039_Script_on start movie < prev    next >
Text File  |  1997-03-18  |  3KB  |  95 lines

  1. on startMovie
  2.   global myCD, myCursor, acroreadpath
  3.   
  4.   if the colorDepth = 4 then
  5.     set the stagecolor = 11
  6.   else
  7.     set the stagecolor = 208
  8.   end if
  9.   
  10.   -- define the 'hand' cursor
  11.   set myCursor to [397, 398]
  12.   cursor -1
  13.   set the exitLock = TRUE
  14.   
  15.   -- determine the CD drive
  16.   
  17.   put CheckDrive("findcd\xxxcd.txt") into myCD
  18.   
  19.   -- find the location of the acrobat reader
  20.   
  21.   -- determine the windows directory
  22.   
  23.   put getOSDirectory() into windir
  24.   -- open the file win.ini for read only
  25.   set myFile = new(xtra "fileio")
  26.   put "\temic.ini" after windir
  27.   put openFile(myFile, windir, 1) into openResult
  28.   
  29.   -- read win.ini into theFile
  30.   
  31.   set theFile = readFile(myFile)
  32.   
  33.   -- find the line for the Acrobat Reader and extract the path
  34.   put offset("reader", theFile) into pdfposition
  35.   put offset(".", theFile) into pdfend
  36.   set pdfend = pdfend + 3
  37.   if pdfposition = 0 then
  38.     -- search the win.ini file
  39.     -- determine the windows directory
  40.     
  41.     put getOSDirectory() into windir1
  42.     
  43.     -- open the file win.ini for read only
  44.     set myFile = new(xtra "fileio")
  45.     put "\win.ini" after windir1
  46.     put openFile(myFile, windir1, 1) into openResult
  47.     
  48.     -- read win.ini into theFile
  49.     
  50.     set theFile = readFile(myFile)
  51.     
  52.     -- find the line for the Acrobat Reader and extract the path
  53.     put offset("pdf=", theFile) into pdfposition1
  54.     if pdfposition1 = 0 then
  55.       alert "The Acrobat Reader could not be found. Please install it from the TEMIC CD."
  56.       exit 
  57.     else
  58.       put char pdfposition1 to pdfposition1 + 50 of theFile into acroreadpath
  59.       put offset(" ", acroreadpath) into pdfend
  60.       put char 5 to pdfend of acroreadpath into acroreadpath
  61.       
  62.     end if
  63.     
  64.     
  65.     closeFile(myFile)
  66.     
  67.   else
  68.     
  69.     put char pdfposition to pdfend of theFile into acroreadpath
  70.     put char 8 to pdfend of acroreadpath into acroreadpath
  71.   end if
  72.   
  73. end
  74.  
  75. on CheckDrive weirdfil
  76.   
  77.   set testfile = EMPTY
  78.   set myFile = 0
  79.   if objectP(myFile) then set myFile = 0
  80.   repeat with I = 66 to 90
  81.     set drive = numToChar( I )
  82.     set myThisPath = string(drive & ":\"& weirdfil)
  83.     set myFile = new(xtra "fileio")
  84.     openfile(myFile, myThisPath, 1)
  85.     set testfile = readFile(myFile)
  86.     if not voidP(testfile) then
  87.       set myfile = 0
  88.       return drive&":"
  89.       exit
  90.     end if 
  91.   end repeat
  92.   alert "Please check, if the TEMIC CD is in your CD drive."
  93. end
  94.  
  95.